<template>
  <div class="cart-box-body">
    <template>
      <table class="cart-table">
        <thead>
          <tr>
            <th>序号</th>
            <th>商品信息</th>
            <th>单价(元)</th>
            <th>数量</th>
            <th>小计(元)</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="(goods,index) in lists" :key="index">
            <td>{{ index + 1 }}</td>
            <td class="goodDetails">
              <img :src="goods.goods_logo">
              <div>
                <p>{{ goods.goods_title }}</p>
                <p>商品编码: WDF{{ goods.id }}-{{goods.goods_id}}</p>
              </div>
            </td>
            <td>￥{{ goods.selling_price }}</td>
            <td>{{ goods.num }}</td>
            <td>￥{{ goods.num * goods.selling_price }}</td>
          </tr>
        </tbody>
      </table>
      <div class="total">
        <div style="text-align:right">应付总价 ：
          <span>￥{{ total }}</span>
        </div>
      </div>
      <!-- <p style="color:red;font-size:12px;text-align:right;line-height:40px">
        <span class="el-icon-star-off"></span> 首单包邮，线上支付约省：￥45.00
      </p> -->
      <div class="QiotatiponList"></div>
    </template>
  </div>
</template>
<script>
import imgsrc from "../../../assets/images/goods1.png"; // 图片
export default {
  name: "careDetails",
  data() {
    return {
      checkedz: 0,
      goods_list: [],
    }
  },

  computed: {
    total() {
      let total = 0
      for (let i in this.lists) {
        total += this.lists[i].selling_price * this.lists[i].num;
      }
      return total.toFixed('2')
    },

  },

  created() {
    this.lists = this.$store.state.QuotationData
  }
}
</script>
<style lang="scss" scoped>
.cart-table {
  border-left: 1px solid #f3f3f3;
  border-right: 1px solid #f3f3f3;
  thead {
    tr {
      border-bottom: 1px solid #f3f3f3;
      line-height: 48px;
      background: #f4f4f4;
      font-size: 14px;
      th {
        border: none;
        &:nth-child(1) {
          width: 100px;
        }
        &:nth-child(2) {
          width: 600px;
        }
        &:nth-child(3) {
          width: 150px;
        }
        &:nth-child(4) {
          width: 200px;
        }
        &:nth-child(5) {
          width: 150px;
        }
      }
    }
  }
  tbody {
    tr {
      border-bottom: 1px solid #f3f3f3;
      th {
        border: none;
      }
      td {
        text-align: center;
        border: none;
        img {
          width: 78px;
          height: 78px;
          padding-right: 10px;
        }
        &:nth-child(5) {
          color: #ff1111;
          font-weight: bold;
        }
        p {
          text-align: left;
          &:nth-child(2),
          &:nth-child(3) {
            font-size: 12px;
            color: #8d8d8d;
          }
        }
      }
      .goodDetails {
        display: flex;
        flex-direction: row;
        align-items: center;
      }
    }
  }
}
.total {
  width: 100%;
  height: 68px;
  line-height: 68px;
  background: #f3f3f3;
  div {
    text-align: right;
    padding-right: 50px;
    span {
      color: #ff1111;
      font-size: 16px;
      font-weight: bold;
    }
  }
}
.QiotatiponList {
  border: 1px solid #f3f3f3;
}
</style>



